package system.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

@Table(name = "sys_func")
@Data
public class SysFunc implements Serializable {
    /**
     * 主键
     */
    @Id
    @GeneratedValue(generator = "JDBC")
    @Column(name = "id")
    @ApiModelProperty(value = "主键")
    private String id;

    /**
     * 父级id
     */
    @Column(name = "pid")
    @ApiModelProperty(value = "父级id")
    private String pid;

    /**
     * 功能名称
     */
    @Column(name = "name")
    @ApiModelProperty(value = "功能名称")
    private String name;

    /**
     * 排序序号
     */
    @Column(name = "order_num")
    @ApiModelProperty(value = "排序序号")
    private Integer orderNum;

    /**
     * 请求方式:GET/POST等
     */
    @Column(name = "fun_method")
    @ApiModelProperty(value = "请求方式:GET/POST等")
    private String funMethod;

    /**
     * 功能地址
     */
    @Column(name = "fun_path")
    @ApiModelProperty(value = "功能地址")
    private String funPath;

    /**
     * 0:菜单,1:功能,2:链接,3:内嵌页
     */
    @Column(name = "fun_type")
    @ApiModelProperty(value = "0:菜单,1:功能,2:链接,3:内嵌页")
    private Integer funType;

    /**
     * 视图名称
     */
    @Column(name = "fun_view")
    @ApiModelProperty(value = "视图名称")
    private String funView;

    /**
     * 菜单图标
     */
    @Column(name = "icon")
    @ApiModelProperty(value = "菜单图标")
    private String icon;

    /**
     * 可见性(0:正常, 1:不显示)
     */
    @Column(name = "no_visible")
    @ApiModelProperty(value = "可见性(0:正常, 1:不显示)")
    private Integer noVisible;

    /**
     * 是否禁用(0:正常, 1:禁用)
     */
    @Column(name = "is_disabled")
    @ApiModelProperty(value = "是否禁用(0:正常, 1:禁用)")
    private Integer isDisabled;

    /**
     * 权限标识
     */
    @Column(name = "permission_id")
    @ApiModelProperty(value = "权限标识")
    private String permissionId;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssZ")
    @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssZ")
    private Date createTime;

    /**
     * 更新时间
     */
    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssZ")
    @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssZ")
    private Date updateTime;

    /**
     * 备注
     */
    @Column(name = "remark")
    @ApiModelProperty(value = "备注")
    private String remark;

    private static final long serialVersionUID = 1L;

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", pid=").append(pid);
        sb.append(", name=").append(name);
        sb.append(", orderNum=").append(orderNum);
        sb.append(", funMethod=").append(funMethod);
        sb.append(", funPath=").append(funPath);
        sb.append(", funType=").append(funType);
        sb.append(", funView=").append(funView);
        sb.append(", icon=").append(icon);
        sb.append(", noVisible=").append(noVisible);
        sb.append(", isDisabled=").append(isDisabled);
        sb.append(", permissionId=").append(permissionId);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", remark=").append(remark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}